package cn.edu.cug.cs.gtl.plugins.modelling.actions;

import cn.edu.cug.cs.gtl.apis.ui.AbstractApplication;
import cn.edu.cug.cs.gtl.apis.ui.actions.AbstractAction;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.util.Locale;
import java.util.ResourceBundle;

public class DataPreprocessingAction extends AbstractAction {

    @Override
    public void initialize(AbstractApplication theApp) {
        ResourceBundle resourceBundle = ResourceBundle.getBundle("modelling-resource", Locale.getDefault());

        name=resourceBundle.getString("menu.modelling.data_preprocessing");
        menuItem.setText(name);


        this.theApp = theApp;
        menuItem.addActionListener(this);
        theApp.getMainFrame().getModellingMenu().add(menuItem);
    }

    /**
     * Invoked when an action occurs.
     *
     * @param e the event to be processed
     */
    @Override
    public void actionPerformed(ActionEvent e) {
        JDialog dialog = new JDialog(theApp.getMainFrame(), "Hello", true);
        dialog.add(new JLabel("Data Preprocessing"));
        dialog.setSize(200, 100);
        dialog.setLocationRelativeTo(theApp.getMainFrame());
        dialog.setVisible(true);
    }
}
